package net.teamclerks.rpgf.inventory.item;

import net.teamclerks.rpgf.character.statsheet.EquipmentStatSheet;
import net.teamclerks.rpgf.script.director.Director;

/**
 * EquipmentItem is any item that can be equipped to a Character.
 * 
 * @author kain
 *
 */
public abstract class EquipmentItem extends Item
{
  /// CONTROL DATA ///
  protected EquipmentStatSheet statSheet;
  
  /// DATAPOINTS ///
  protected int equipmentSlot;
  
  /// PUBLIC CONSTRUCTOR ///
  public EquipmentItem(Director director)
  {
    super(director);
  }
  
  /// PUBLIC METHODS ///
  /**
   * Convenience method for the following:<br/><br/>
   * <code>item.getEquipmentStatSheet().getStats().get(slot).getValue();</code>
   * Returns <code>-1</code> upon error or non-existant statSlot.
   * @param statSlot
   */
  public final double getStat(int statSlot)
  {
    if(this.statSheet.getStats().get(statSlot) == null)
    {
      return -1;
    }
    return this.statSheet.getStats().get(statSlot).getValue();
  }
  /**
   * Gets the StatSheet associated with this EquipmentItem.
   * @return stats
   */
  public final EquipmentStatSheet getEquipmentStatSheet()
  {
    return this.statSheet;
  }
  /**
   * Sets the StatSheet to be associated with this EquipmentItem.
   * @param stats
   */
  public final void setEquipmentStatSheet(EquipmentStatSheet stats)
  {
    this.statSheet = stats;
  }
  /**
   * @return the slot
   */
  public final int getSlot() {
  return equipmentSlot;
  }
  /**
   * @param slot the slot to set
   */
  public final void setSlot(int slot) {
  this.equipmentSlot = slot;
  }
}
